import java.util.Stack;

public class Test {


    public static void main(String[] args) {
        MyStack2<Integer> myStack2=new MyStack2<>();
        myStack2.push(10);
        myStack2.push(20);
        myStack2.push(30);
        myStack2.push(40);
        System.out.println(myStack2.pop());
        System.out.println(myStack2.peek());
        System.out.println(myStack2.peek());
    }
    public static void main2(String[] args) {
        MyStack myStack=new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        System.out.println(myStack.pop());
        System.out.println(myStack.peek());
    }

    public static void main1(String[] args) {
        Stack<Integer> stack=new Stack<>();//实例化栈
        //push叫入栈
        stack.push(12);
        stack.push(23);
        stack.push(34);
        stack.push(45);
        stack.push(56);
        //pop叫出栈
        Integer x=stack.pop();
        System.out.println(x);

        Integer y=stack.peek();
        System.out.println(y);

        boolean fls=stack.isEmpty();


    }
}
